package com.tte.common.model.tenum;

public enum ResultCode {
    OK(0,"成功"),
    FAIL(-1,"失败"),
    PARAMETER_EMPTY (101,"参数为空"),
    PARAMETER_FORMAT (102,"参数格式错误"),
    USER_EMPTY(201,"用户不存在"),
    USER_PASS(202,"密码错误"),
    USER_LOCK(203,"用户被锁定"),
    TOKEN(204,"TOKEN失效"),
    DATA_EMPTY(301,"未查询到数据"),
    ;

    private int code;
    private String value;

    ResultCode(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public int code() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String value() {
        return this.value;
    }

    public void setValue(String value) {
        this.value = value;
    }
    public static String Value(int code) {
        for (ResultCode res : values()) {
            if(res.code() == code) {
                return res.value();
            }
        }
        return null;
    }
}
